<?php include "../public/header.php";?>
<?php include "../public/header_edit.php";?>
<body id="optPage">
<form class="layui-form layui-form-pane" id="commentForm">
    <div class="page-title"><div class="page-title-con"><span>转入文件夹</span><div class="move_title"></div><?php include "../public/sub.php";?></div></div>
    <div class="main-container">
        <div class="block-generic">
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label"><text>*</text>选择文件夹</label>
                        <div class="layui-input-block">
                            <div id="muid"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</form>
<script>
    var param_ids = getQueryVariable('ids') || '';

    layui.use(['laytp', 'form'], function() {
        var form = layui.form, layer = layui.layer;
        render_input_attr();

        facade.ajax({type: 'get', url: ask_engin_fold_zhuan,data:{ids:param_ids}}).done(function(res){
            if (res.code === 2000) {

                xmselect_dan('muid', res.data.muid, '', function (res) {
                    if(res.arr && res.arr.length > 0){
                        $("#muid").find('xm-select').removeClass('error');
                    }else{
                        $("#muid").find('xm-select').addClass('error');
                    }
                });

                public_upload_file_load('upload_files', res.data.files);
                render_date();
                render_from();
                initParseMoney();
            }
        });

        form.on('submit(add)', function(data){
            var validRes = $("#commentForm").valid();

            if(!data.field.muid){
                $("#muid").find('xm-select').addClass('error');
                validRes = false;
            }else{
                $("#muid").find('xm-select').removeClass('error');
            }

            if(!validRes){return false;}

            data.field.ids = param_ids;
            facade.ajax({url: ask_engin_fold_zhuan, data:data.field}).done(function(res){
                if (res.code === 2000) {
                    dataPostTimeOut();
                }
            });

            return false;
        });

    });

</script>
</body>
</html>
